<template>
  <div class="basic-from">
    <v-dialog title="发改立项信息详细" :show.sync="dialogVisible" @beforeClose="beforeClose" width="1200px">
      <div class="resource-manage">
        <div class="card-box">
          <div class="card-title">基本信息</div>
          <el-form ref="applyForm" :model="data" class="form-wrap">
            <el-form-item label="项目名称" prop="projectName">
              <span class="in_txt">{{data.projectName}}</span>
            </el-form-item>
            <el-form-item label="国家编码" prop="countryCode">
              <span class="in_txt">{{data.countryCode}}</span>
            </el-form-item>
            <el-form-item label="项目地址" prop="addressDetail">
              <span class="in_txt">{{data.addressDetail}}</span>
            </el-form-item>
            <el-form-item label="立项时间" prop="applyYear">
              <span class="in_txt">{{data.applyYear}}(年)</span>
            </el-form-item>
            <el-form-item label="行业归口" prop="industryCode">
              <span class="in_txt">{{data.industryCode | dict('industry_code')}}</span>
            </el-form-item>
            <el-form-item label="总投资" prop="totalInvest">
              <span class="in_txt">{{data.totalInvest | thousandMoney}}</span>
            </el-form-item>
            <el-form-item label="申请单位" prop="companyName">
              <span class="in_txt">{{data.companyName}}</span>
            </el-form-item>
            <el-form-item label="计划开工时间" prop="beginDate">
              <span class="in_txt">{{data.beginDate}}</span>
            </el-form-item>
            <el-form-item label="计划竣工时间" prop="endDate">
              <span class="in_txt">{{data.endDate}}</span>
            </el-form-item>
            <el-form-item label="建设内容" prop="projectContent" class="full">
              <span class="in_txt">{{data.projectContent}}</span>
            </el-form-item>
          </el-form>
        </div>
      </div>
      <div class="resource-manage">
        <div class="card-box">
          <div class="card-title">项目建议书</div>
          <el-form ref="applyForm" :model="data" class="form-wrap">
            <el-form-item label="事项名称" prop="itemName">
              <span class="in_txt">{{data.itemName}}</span>
            </el-form-item>
            <el-form-item label="提供单位" prop="deptName">
              <span class="in_txt">{{data.deptName}}</span>
            </el-form-item>
            <el-form-item label="附件" prop="fileName" v-if="data.md5Value != null">
              <a class="in_href" :href="downUrl" target="_blank">{{data.fileName}}</a>
            </el-form-item>
          </el-form>
        </div>
      </div>
      <div class="resource-manage">
        <div class="card-box">
          <div class="card-title">财务决算报告</div>
          <el-form ref="applyForm" :model="data" class="form-wrap">
            <el-form-item label="宗地号" prop="zdh">
              <span class="in_txt">{{data.zdh}}</span>
            </el-form-item>
            <el-form-item label="土地面积" prop="tdmj">
              <span class="in_txt">{{data.tdmj}}</span>
            </el-form-item>
            <el-form-item label="建筑面积" prop="jzmj">
              <span class="in_txt">{{data.jzmj}}</span>
            </el-form-item>
          </el-form>
        </div>
      </div>
      <span slot="foot">
        <el-button @click="dialogVisible = false">取 消</el-button>
      </span>
    </v-dialog>
  </div>
</template>

<script>
import { getObj, download } from "../api/fgprojectdata";
let moment = require('moment')
export default {
  data () {
    return {
      data: {},
      tableData: [],
      dialogVisible: false,
      downUrl: "",
    };
  },
  methods: {
    show (id) {
      getObj(id).then((resp) => {
        this.dialogVisible = true;
        this.data = resp.data.data;
        if (this.data.beginDate != null) {
          this.data.beginDate = moment(this.data.beginDate).format('YYYY年MM月DD日')
        }
        if (this.data.endDate != null) {
          this.data.endDate = moment(this.data.endDate).format('YYYY年MM月DD日')
        }
        this.downUrl = "/api/fgprojectdata/download/" + this.data.fgProjectId;
      });
    },
    downLoad () {
      download(this.data.fgProjectId).then((resp) => { });
    },
    beforeClose (done) {
      done();
    },
  },
};
</script>

<style lang='scss' scoped>
.resource-manage {
  .card-box {
    padding: 0;
    .in_txt {
      color: #999999;
    }
    .in_href {
      color: #409eff;
    }
  }
}
</style>
